<div className="think-box-shadow">
    <fieldset>
        <legend>条件搜索</legend>
        <form action="{:sysuri()}" id="TagsDataSearch" autocomplete="off"
              class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">

            <!--            <div className="layui-form-item layui-inline">-->
            <!--                <label className="layui-form-label">订单号</label>-->
            <!--                <label className="layui-input-inline">-->
            <!--                    <input className="layui-input" name="sn" placeholder="请输入订单号" value="{$get.sn|default=''}">-->
            <!--                </label>-->
            <!--            </div>-->

            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">创建时间</label>
                <label class="layui-input-inline">
                    <input class="layui-input" data-date-range name="create_at" placeholder="请选择创建时间"
                           value="{$get.create_at|default=''}">
                </label>
            </div>

            <div class="layui-form-item layui-inline">
                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
                <!-- {if auth('add')} -->
                <button class="layui-btn layui-btn-primary" data-title="添加公示企业"
                        data-modal="{:url('add')}?jbgs_id={$jbgs_id}" type="button">
                    <i class="layui-icon">&#xe61f;</i> 添 加
                </button>
                <!-- {/if} -->
            </div>
        </form>
    </fieldset>



    <table id="TagsData" data-url="{:sysuri()}" data-target-search="#TagsDataSearch"></table>
</div>


<script>
    $(function () {
        $('#TagsData').layTable({
            even: true, height: 'full',
            sort: {field: 'qymc desc', type: 'desc'},
            where:{jbgs_id:{$jbgs_id}},
            cols: [[
                {field: 'sbsj', title: '申报时间', align: 'center', minWidth: 140},
                {field: 'qymc', title: '企业名称', align: 'center', minWidth: 140},
                {field: 'dyxmmc', title: '对应项目名称', align: 'center', minWidth: 140},
                {field: 'jlzj', title: '获得的奖励资金（万元）', align: 'center', minWidth: 140},
                {field: 'jibie', title: '级别', align: 'center', minWidth: 100},
                {field: 'beizhu', title: '备注', align: 'center', minWidth: 100},
                {toolbar: '#ToolbarTagsData', title: '操作面板', minWidth: 170, align: 'center', fixed: 'right'},
            ]]
        });

        // 数据状态切换操作
        layui.form.on('switch(StatusSwitchTagsData)', function (obj) {
            var data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
            $.form.load("{:url('state')}", data, 'post', function (ret) {
                if (ret.code < 1) $.msg.error(ret.info, 3, function () {
                    $('#TagsData').trigger('reload');
                });
                return false;
            }, false);
        });
    });
</script>

<!-- 数据状态切换模板 -->
<script type="text/html" id="StatusSwitchTagsDataTpl">
    <!--{if auth("state")}-->
    <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitchTagsData"
           {{-d.status>0?'checked':''}}>
    <!--{else}-->
    {{-d.status ? '<b class="color-green">已激活</b>' : '<b class="color-red">已禁用</b>'}}
    <!--{/if}-->
</script>

<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTagsDataTplModal">
    <input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}"
           data-value="id#{{d.id}};jbgs_id#{{d.jbgs_id}};action#sort;sort#{value}" data-loading="false"
           value="{{d.sort}}" className="layui-input text-center">
</script>

<!-- 操控面板的模板 -->
<script type="text/html" id="ToolbarTagsData">

    <!--{if auth("edit")}-->
    <a class="layui-btn layui-btn-sm" data-title="编辑数据" data-width="80%"
       data-modal='{:url("edit")}?id={{d.id}}&jbgs_id={$jbgs_id}'>编 辑</a>
    <!--{/if}-->

    <!--{if auth("remove")}-->
    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除？"
       data-action="{:url('remove')}" data-value="id#{{d.id}}">删 除</a>
    <!--{/if}-->
</script>